import { ISchema } from '@formily/react'

export const UploadImage: ISchema = {
  type: 'object',
  properties: {
    apiName: {
      type: 'string',
      enum: [
        { label: 'platform', value: 'platform' },
        { label: 'tenant', value: 'tenant' },
      ],
      'x-decorator': 'FormItem',
      'x-component': 'Select',
      'x-component-props': {
        defaultValue: 'tenant',
      },
    },
    maxSize: {
      type: 'number',
      'x-decorator': 'FormItem',
      'x-component': 'NumberPicker',
      'x-component-props': {
        defaultValue: 10,
        min: 1,
      },
    },
    accept: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'Input',
      'x-component-props': {
        defaultValue: '.jpg,.jpeg,.png,.gif',
      },
    },
    maxCount: {
      type: 'number',
      'x-decorator': 'FormItem',
      'x-component': 'NumberPicker',
      'x-component-props': {
        defaultValue: 1,
        min: 1,
      },
    },
  },
}
